package com.ztc.util;

import java.util.regex.Pattern;

public class ValidateUtil {

	/**
	 * 判断是否是数字
	 * @param text
	 * @return
	 */
	public static boolean isNumber(String text) {
		String regex = "^[-\\+]?[\\d,]*(\\.[0-9]+)?$";
		return Pattern.matches(regex, text);
	}
	
	/**
	 * 判断是否是英文
	 * @param text
	 * @return
	 */
	public static boolean isEnglish(String text) {
		String regex = "^[a-zA-Z]+$";
		return Pattern.matches(regex, text);
	}
	
	public static void main(String[] args) {
		System.out.println(isNumber("1,111.2"));
	}
}
